package com.lifeng.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * Created by lifeng on 2018/5/21.
 */
@Component
//可以使用locations指定读取的properties文件路径，如果不指定locations就会读取默认的properties配置文件
@PropertySource(value = "mytest.properties",encoding = "UTF-8")
@ConfigurationProperties(prefix = "myuser")
public class MyTestConfig2 {
    public String name;
    private String password;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
